package com.xinqing.test.LetCode;

/**
 * @Author:CHQ
 * @Date:2021/7/21 10:07
 * @Description
 */
public class MirrorTree {
    public static void main(String args[]) {
        TreeNode root=new TreeNode(1);
        TreeNode l=new TreeNode(2);
        TreeNode r=new TreeNode(3);
        root.left=l;
        root.right=r;

        TreeNode res=test(root);
        System.out.print(res.toString());
    }
    public static TreeNode test(TreeNode root){
        if(root==null){
            return null;
        }
        TreeNode temp=test(root.left);
        root.left=test(root.right);
        root.right=temp;
        return root;
    }
}
